<?php 
$re = "/add/";
$str = uri_string();
if (preg_match($re, $str)) {
    $sub = TRUE;
} else {
    $sub = FALSE;
}
?>
<div class="title-menu">
    <h2><?php if($sub==TRUE) echo "Thêm banner"; else echo "Sửa banner";?></h2>
</div>
<nav class="bonus">
    <a href="<?php echo base_url("backend/banner");?>"><< Quay lại</a>
</nav>
<article>
    <form method="post" action="" enctype="multipart/form-data">
        <fieldset>
            <ul class="error">
                <?php echo isset($error)?$error:'';?>                      
            </ul>          
            <p>
                <label>Hình banner:</label>
                <?php if (isset($img->img)) { ?>
                <img src="<?php echo base_url($img->img); ?>" width="100" height="100" alt="No Image"/>
            <?php } ?>
                <input type="file" name="img" value="<?php echo isset($img->img)?$img->img:'';?>"/>
            </p>           
            <p>
                <label></label>
                <input type="submit" name="add" value="<?php if($sub == TRUE)echo "Thêm"; else echo "Sửa";?>"/>
            </p>
        </fieldset>
    </form>
</article>